#include "NumberObject.h"

OBJECT_DEFINE_START (NumberObject, number_object)

void
number_object_init (NumberObject* obj)
{
        object_init (OBJECT (obj));
        object_set_destory_func (obj, number_object_destory);
        obj->number      = 0;
        obj->number_type = VALUE_TYPE_NUMBER;
}

void
number_object_destruction (NumberObject* obj __attribute_maybe_unused__)
{
        return;
}

void
number_object_set_number (NumberObject* obj, int number)
{
        if (!obj)
                return;
        obj->number = number;
}

void
number_object_set_type (NumberObject* obj, bool is_type_range)
{
        if (!obj) {
                OBJECT_WARNING_TOOL (NumberObject, set_type, "对象为空！\n");
                return;
        }
        if (is_type_range)
                obj->number_type = VALUE_TYPE_RANGE;
        else
                obj->number_type = VALUE_TYPE_NUMBER;
}
